hackerrank collections.namedtuple() problem solution in python programming